class User < ActiveRecord::Base

  has_many :comments
  has_many :posts
  has_many :contents
  has_many :enrollments
  has_many :answers
  has_many :courses
 
  validates_uniqueness_of(:login)
  
  validates_presence_of(:name)
  validates_presence_of(:login)
  validates(:password, :presence => true, :within => 3..60)
  
  validates_length_of(:name, :within => 3..60, :too_short => "Nome dever ter no minimo 3 caracteres", :too_long => "Limite de caracteres excedido")
  validates_length_of(:login, :within => 3..20, :too_short => "Login dever ter no minimo 3 caracteres", :too_long => "Limite de caracteres excedido")
  validates_length_of(:password, :within => 3..20, :too_short => "Senha dever ter no minimo 3 caracteres", :too_long => "Limite de caracteres excedido")

#   fazendo teste 
end
